<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>意见反馈</title>
		<script src="__INDEX__/js/mui.min.js"></script>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/yund.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">意见反馈</h1>
		</header>
		<div class="mui-content gljcz_content">
			<form id="my_form" class="layui-form update_form" action="" method="post">
			<div class="bt fk_bt">请填写反馈内容</div>
			<div class="yjfk_nr"><textarea id="content" lay-verify="required" name="msg_content" cols="70" rows="4" placeholder="请描述您在使用的时候遇到的问题和意见"></textarea></div>
			<div class="bt fk_bt">请填写你的联系电话</div>
			<div class="yjfk_nr"><input type="text" lay-verify="required" name="user_name" placeholder="请填写你的联系电话"></div>
			<button  id='change_but' class="layui-btn tixian_btn" lay-submit lay-filter="demo1">立即提交</button>
			</form>
		</div>
	</body>

</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script type="text/javascript" src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	layui.use(['form'], function(){
		var $ = layui.jquery,form = layui.form;
	  	//监听提交
		form.on('submit(demo1)', function(data){
			$('#change_but').addClass("layui-btn-disabled");
			set_content();
			return false;
		});
	})
	
	function set_content(){
		$.ajax({
			type:"post",
			url: "{:url('index/member/feedback')}",
			data: $('#my_form').serialize(),//表单数据
			success: function(data) {
				
				layer.msg(data.msg, {
				  icon: 1,
				  time: 1500 //2秒关闭（如果不配置，默认是3秒）
				}, function(){
					  if(data.code == 200) {
							location.href = data.url
					  }
				}); 
			}
		})
	}
	
</script>